/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.a1anwang.okble.demo.widget;

/**
 * IRefresh
 *
 * @since 2021-06-03
 * */
public interface IRefresh {
    /**
     * 告诉调用者，此时正在刷新
     */
    void refreshFinish();
    /**
     * 告诉调用者，此时正在刷新
     *
     * @param listener listener
     */
    void setRefreshListener(RefreshListener listener);
    /**
     * 告诉调用者，此时正在刷新
     *
     * @param headComponent headComponent
     */
    void setHeadComponent(HeadBaseComponent headComponent);
    /**
     * RefreshListener
     *
     * @since 2021-05-06
     * */
    interface RefreshListener {
        /**
         * 告诉调用者，此时正在刷新
         */
        void onRefresh();

        /**
         * 是否允许刷新
         *
         * @return  enableRefresh
         */
        boolean enableRefresh();
    }
}
